<?php
/**
 * Nadëb (Makú-Nadëb)
 * 
 * @author     Mateus Martins <mateusweb@gmail.com>
 * @copyright  Copyright 2010 mateusweb.com.br
 * @license    http://www.gnu.org/licenses/gpl.html | GPL
 * @package    Nadeb
 * @version    1.0.0
 */


/**
 * Class Nadeb_Report_ShowData_Set
 * Monta um XHTML do tipo exibir e não exibir para chamar o metodo swapAction do Controlador Crud 
 * 
 * @category   Nadeb
 * @package    Nadeb_Report_ShowData_Set
 * @copyright  Copyright 2010 mateusweb.com.br
 * @license    http://www.gnu.org/licenses/gpl.html | GPL
 */
class Nadeb_Report_ShowData_Swap extends Nadeb_Report_ShowData_Variables
{
	/**
	 * @var object
	 */
	protected static $_instance = null;
	
	/**
	 * @var array
	 */
	public $JSInstances;
	
	/**
	 * Metodo Construtor
	 * 
	 * @return void
	 */
	private function __construct()
	{
	}
	
    /**
     * Retorna a instancia de Nadeb_Report_ShowData_Swap
     * Implementação do Singleton pattern 
     *
     * @return Nadeb_JScontroller
     */
    public static function get_instance()
    {
        if (null === self::$_instance)
        {
            self::$_instance = new self();
        }

        return self::$_instance;
    }
	
    function get_xhtml()
    {
		$ar_param = explode(",",$this->params);
		if( $this->string == "1")
		{
			$xhtml = str_replace("//","/","<a href='{$ar_param[0]}/id/{$this->id}' class='set_swap'><img src='/public/admin/images/set_1.png' width='16' height='16' alt='Remover' /></a>");
		}
		else
		{
			$xhtml = str_replace("//","/","<a href='{$ar_param[0]}/id/{$this->id}' class='set_swap'><img src='/public/admin/images/set_0.png' width='16' height='16' alt='Adicionar' /></a>");
		}
    	
    	return $xhtml;
    }
	
}
